
/**
 * 求一个3*3矩阵对角线元素之和
 * 0 0 1 1 2 2  0 2 1 1 2 0
*/
#if  1
#include <stdio.h>
int main()
{
    int num[][3] = {
        {1,2,3},
        {4,5,6},
        {7,8,9}
    };

    int sum[3] = {0};
    for (int i = 0; i < 3; i++)
    {
        /* code */
        sum[0] += num[i][i];
        sum[1] += num[i][3 - i - 1];
    }

    for (int i = 0; i < 2; i++)
    {
        /* code */
        sum[3] += sum[i];
    }
    printf("%d",sum[3]);
    
    
    return 0;
}
#endif